package org.example.simplemanagementsystem.mapper;

import org.apache.ibatis.annotations.*;
import org.example.simplemanagementsystem.pojo.Emp;
import org.example.simplemanagementsystem.pojo.Student;
import org.example.simplemanagementsystem.pojo.StudentQueryParam;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
    List<Student> list(StudentQueryParam studentQueryParam);

    @Insert("insert into student(name, no, gender, phone, id_card, is_college, address, degree, graduation_date, clazz_id) " +
            "values (#{name},#{no},#{gender},#{phone},#{idCard},#{isCollege},#{address},#{degree},#{graduationDate},#{clazzId})")
    void add(Student student);


    Student getInfoById(Integer id);

    @Update("update student set violation_score = #{violationScore}, violation_count = #{violationCount}, update_time = #{updateTime} where id = #{id}")
    void violation(Student student);


    void update(Student student);

    void delete(List<Integer> ids);

    @MapKey("name")
    List<Map> getStudentDegreeData();

    List<Map> getStudentCountData();
}
